package com.lhy.admin.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 文件映射模型
 * </p>
 * @author 86159
 * @date 2021-05-22 16:50:22
 * Copyright (c) 2021 
 */
@Data
@TableName("t_file_mapping")
@Schema(name="FileMapping", description="文件映射")
public class FileMapping implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 文件key
     */
    @Schema(description= "文件key")
    @TableField("`key`")
    private String key;

    /**
     * 文件地址
     */
    @Schema(description= "文件地址")
    @TableField("url")
    private String url;

    /**
     * 扩展名
     */
    @Schema(description="扩展名")
    @TableField("ext")
    private String ext;

    /**
     * 文件大小
     */
    @Schema(description="文件大小")
    @TableField("size")
    private Integer size;

    /**
     * 文件HASH
     */
    @Schema(description="文件HASH")
    @TableField("hash")
    private String hash;

    /**
     * MIME类型
     */
    @Schema(description="MIME类型")
    @TableField("mime")
    private String mime;

    /**
     * 文件名
     */
    @Schema(description="文件名")
    @TableField("name")
    private String name;

    /**
     * 是否目录
     */
    @Schema(description="是否目录")
    @TableField("folder")
    private Integer folder;

    /**
     * 父文件(所属目录)
     */
    @Schema(description="父文件(所属目录)")
    @TableField("parent")
    private Integer parent;

    /**
     * 时长
     */
    @Schema(description="时长")
    @TableField("duration")
    private Integer duration;

    /**
     * 祖先ID路径
     */
    @Schema(description="祖先ID路径")
    @TableField("ancestors")
    private String ancestors;

    /**
     * 下载量
     */
    @Schema(description="下载量")
    @TableField("downloads")
    private Integer downloads;

    /**
     * 上传时间
     */
    @Schema(description="上传时间")
    @TableField("uploaded")
    private LocalDateTime uploaded;

    /**
     * 创建者
     */
    @Schema(description="创建者")
    @TableField("creator")
    private Integer creator;

    @TableField("updated")
    private LocalDateTime updated;

    /**
     * 更新人
     */
    @Schema(description="更新人")
    @TableField("updater")
    private Integer updater;


    public static final String ID = "id";
    public static final String KEY = "key";
    public static final String URL = "url";
    public static final String EXT = "ext";
    public static final String SIZE = "size";
    public static final String HASH = "hash";
    public static final String MIME = "mime";
    public static final String NAME = "name";
    public static final String FOLDER = "folder";
    public static final String PARENT = "parent";
    public static final String DURATION = "duration";
    public static final String ANCESTORS = "ancestors";
    public static final String DOWNLOADS = "downloads";
    public static final String UPLOADED = "uploaded";
    public static final String CREATOR = "creator";
    public static final String UPDATED = "updated";
    public static final String UPDATER = "updater";

}
